<?php
function delete_subscription($id_user) {
	if (isset($id_user)) {
		require("model/subscriptionBD.php");
		if (delete_subscription_db($id_user)) {
			$message = "Desabonnement valide";
			require("view/valid.tpl");
		} else {
			$message = "Deja Desabonne.";
			require("view/error.tpl");
		}
	}
}

function view_subscription($id_user) {
	require("model/subscriptionBD.php");
	$tab = select_user();
	if(sizeof($tab['id_user']) > 0) {
		require("view/my_account.tpl");
	} else {
		$message = "Aucun abonnement disponible pour le moment";
		require("view/my_account.tpl");
	}	
}

function add_subscription($id_user) {
	require("Model/subscriptionBD.php");
	if(add_subscriptionBD($id_user)){
		$message = "Abonnement Valide";
		require("view/valid.tpl");
	} else {
		$message = "Deja Abonne.";
		require("view/error.tpl");
	}	
}



?>